import request from '@/utils/request'
import mockRequest from '@/utils/mockRequest'
/**
 * @description 获取收获地址
 * @returns
 */
export const reqAddress = () => {
  return mockRequest.get('/api/user/userAddress/auth/findUserAddressList')
}
/**
 * @description 获取购物车商品
 * @returns
 */
export const reqCartGoods = () => {
  return request.get('/api/order/auth/trade')
}
/**
 * @description 提交订单
 * @param {*} data
 * @returns
 */
export const reqSubmitOrder = (data) => {
  return request.post(`/api/order/auth/submitOrder?tradeNo=${data.tradeNo}`, data)
}
/**
 * @description 获取订单支付信息
 * @param {*} orderId
 * @returns
 */
export const reqTotalMoney = (orderId) => {
  return request.get(`/api/payment/weixin/createNative/${orderId}`)
}
/**
 * @description 获取支付成功状态
 * @param {*} id
 * @returns
 */
export const reqGetOrderPay = (id) => {
  return request.get(`/api/payment/weixin/queryPayStatus/${id}`)
}
/**
 * @description 获取订单列表
 * @param {*} page
 * @param {*} limit
 * @returns
 */
export const reqOrderInfo = (page, limit) => {
  return request.get(`/api/order/auth/${page}/${limit}`)
}
